package controllers;

import models.Mob;
import models.Projectile;
import models.Tower;

public class ProjectileController {

	private Projectile projectile;
	
	//Construtor
	public ProjectileController(Projectile projectile) {
		this.projectile = projectile;
	}
	public ProjectileController() {
	}

	
	public boolean hitMob(Mob mob){
		int health = mob.getHealth();
		switch(projectile.getType()){
		case HIT_ONE: //Tira 1 de vida
			health--;
			break;
		case HIT_TWO: //Tira 2 de vida
			health-=2;
			break;
		case HIT_FOUR: //Tira 4 de vida
			health-=4;
			break;
		default:
			return false;
		}
		mob.setHealth(health);
		return true;
	}
	public boolean hitMob(Mob mob, Tower towerFiringPower){
		int health = mob.getHealth();
		switch(towerFiringPower.getType()){
		case HIT_ONE: //Tira 1 de vida
			health--;
			break;
		case HIT_TWO: //Tira 2 de vida
			health-=2;
			break;
		case HIT_FOUR: //Tira 4 de vida
			health-=4;
			break;
		default:
			return false;
		}
		mob.setHealth(health);
		return true;
	}

}
